//用户信息数据
const createMenuList = {
  0: [
    {
      id: '0',
      icon: 'Menu',
      name: '首页',
      parentName: null,
      permissions: '',
      sort: 0,
      type: 0,
      url: '/home',
    },
    {
      id: '1',
      icon: 'Lock',
      name: '权限管理',
      parentName: null,
      permissions: '',
      sort: 0,
      type: 0,
      url: '/authority',
      children: [
        {
          id: '1-2',
          icon: 'ScaleToOriginal',
          name: '岗位管理',
          parentId: '1',
          permissions: null,
          sort: 1,
          type: 0,
          url: '/authority/post',
          children: [],
        },
        {
          id: '1-3',
          icon: 'SetUp',
          name: '部门管理',
          parentId: '1',
          permissions: null,
          sort: 2,
          type: 0,
          url: '/authority/dept',
          children: [],
        },
      ],
    },
    {
      id: '2',
      icon: 'Setting',
      name: '系统设置',
      parentName: null,
      permissions: '',
      sort: 1,
      type: 0,
      url: '/sys',
      children: [
        {
          id: '2-1',
          icon: 'List',
          name: '菜单管理',
          parentId: '2',
          permissions: 'sys.menu',
          sort: 0,
          type: 0,
          url: '/sys/menu',
          children: [],
        },
      ],
    },
    {
      id: '3',
      icon: 'User',
      name: '用户管理',
      parentName: null,
      permissions: '',
      sort: 2,
      type: 0,
      url: '/user',
      children: [
        {
          id: '1-1',
          icon: 'User',
          name: '用户列表',
          parentId: '1',
          permissions: 'cuser.user',
          sort: 0,
          type: 0,
          url: '/user/user-list',
          children: [],
        },
        {
          id: '3-1',
          icon: 'Avatar',
          name: '用户角色',
          parentId: '3',
          permissions: 'sys:tenantrole:all,sys:tenantrole:list',
          sort: 1,
          type: 0,
          url: '/user/user-role',
          children: [],
        },
      ],
    },
  ],
  1: [
    {
      id: '1-1',
      icon: 'icon-lock',
      name: '系统管理',
      parentId: '1',
      permissions: '',
      sort: 0,
      type: 0,
      url: '/sys',
    },
  ],
}

export default [
  // 获取菜单信息
  {
    url: '/dev-api/getMenu/list',
    method: 'post',
    response: ({ body }) => {
      //获取请求头携带token
      const userIds = body.userId
      if (userIds.length > 0) {
        return {
          code: 200,
          result: 'success',
          msg: '操作成功！',
          data: { menuList: createMenuList[userIds - 0] },
        }
      } else {
        return { code: 403, msg: '无权限访问！', data: {} }
      }
    },
  },
]
